//
//  UITableViewCell.swift
//  Documentation
//
//  Created by Toj on 11/18/22.
//

open class UITableViewCell : UIView, NSCoding, UIGestureRecognizerDelegate {
    
    
    // Designated initializer.  If the cell can be reused, you must pass in a reuse identifier.  You should use the same reuse identifier for all cells of the same form.
    @available(iOS 3.0, *)
    public init(style: UITableViewCell.CellStyle, reuseIdentifier: String?)
    
    public init?(coder: NSCoder)
    
    
    /// Requests the cell update its configuration for its current state. This method is called automatically
    /// when the cell's `configurationState` may have changed, as well as in other circumstances where an
    /// update may be required. Multiple requests may be coalesced into a single update at the appropriate time.
    @available(iOS 14.0, *)
    open func setNeedsUpdateConfiguration()
    
    
    /// When YES, the cell will automatically call -updatedConfigurationForState: on its `contentConfiguration` when the cell's
    /// configuration state changes, and apply the updated configuration back to the cell. The default value is YES.
    @available(iOS 14.0, *)
    open var automaticallyUpdatesContentConfiguration: Bool
    
    
    // Custom subviews should be added to the content view.
    open var contentView: UIView { get }
    
    
    // These properties will always return nil when a non-nil `contentConfiguration` is set.
    @available(iOS, introduced: 3.0, deprecated: 100000, message: "Use UIListContentConfiguration instead, this property will be deprecated in a future release.")
    open var imageView: UIImageView? { get } // default is nil.  image view will be created if necessary.
    
    @available(iOS, introduced: 3.0, deprecated: 100000, message: "Use UIListContentConfiguration instead, this property will be deprecated in a future release.")
    open var textLabel: UILabel? { get } // default is nil.  label will be created if necessary.
    
    @available(iOS, introduced: 3.0, deprecated: 100000, message: "Use UIListContentConfiguration instead, this property will be deprecated in a future release.")
    open var detailTextLabel: UILabel? { get } // default is nil.  label will be created if necessary (and the current style supports a detail label).
    
    
    /// When YES, the cell will automatically call -updatedConfigurationForState: on its `backgroundConfiguration` when the cell's
    /// configuration state changes, and apply the updated configuration back to the cell. The default value is YES.
    @available(iOS 14.0, *)
    open var automaticallyUpdatesBackgroundConfiguration: Bool
    
    
    // Always nil when a non-nil `backgroundConfiguration` is set. The 'backgroundView' will be added as a subview behind all other views.
    open var backgroundView: UIView?
    
    // Always nil when a non-nil `backgroundConfiguration` is set. The 'selectedBackgroundView' will be added as a subview directly above the backgroundView if not nil, or behind all other views. It is added as a subview only when the cell is selected. Calling -setSelected:animated: will cause the 'selectedBackgroundView' to animate in and out with an alpha fade.
    open var selectedBackgroundView: UIView?
    
    // Always nil when a non-nil `backgroundConfiguration` is set. If not nil, takes the place of the selectedBackgroundView when using multiple selection.
    @available(iOS 5.0, *)
    open var multipleSelectionBackgroundView: UIView?
    
    // 重用标识
    open var reuseIdentifier: String? { get }
    
    // 如果单元格是可重用的(具有重用标识符)
    // 则在从表视图方法dequeueReusableCellWithIdentifier: 返回单元格之前调用.
    // 子类必须调用super.
    open func prepareForReuse()
    
    
    open var selectionStyle: UITableViewCell.SelectionStyle // default is UITableViewCellSelectionStyleDefault.
    
    open var isSelected: Bool // set selected state (title, image, background). default is NO. animated is NO
    
    open var isHighlighted: Bool // set highlighted state (title, image, background). default is NO. animated is NO
    
    open func setSelected(_ selected: Bool, animated: Bool) // animate between regular and selected state
    
    open func setHighlighted(_ highlighted: Bool, animated: Bool) // animate between regular and highlighted state
    
    
    open var editingStyle: UITableViewCell.EditingStyle { get } // default is UITableViewCellEditingStyleNone. This is set by UITableView using the delegate's value for cells who customize their appearance accordingly.
    
    open var showsReorderControl: Bool // default is NO
    
    open var shouldIndentWhileEditing: Bool // default is YES.  This is unrelated to the indentation level below.
    
    
    open var accessoryType: UITableViewCell.AccessoryType // default is UITableViewCellAccessoryNone. use to set standard type
    
    open var accessoryView: UIView? // if set, use custom view. ignore accessoryType. tracks if enabled can calls accessory action
    
    open var editingAccessoryType: UITableViewCell.AccessoryType // default is UITableViewCellAccessoryNone. use to set standard type
    
    open var editingAccessoryView: UIView? // if set, use custom view. ignore editingAccessoryType. tracks if enabled can calls accessory action
    
    
    open var indentationLevel: Int // adjust content indent. default is 0
    
    open var indentationWidth: CGFloat // width for each level. default is 10.0
    
    @available(iOS 7.0, *)
    open var separatorInset: UIEdgeInsets // allows customization of the separator frame
    
    
    open var isEditing: Bool // show appropriate edit controls (+/- & reorder). By default -setEditing: calls setEditing:animated: with NO for animated.
    
    open func setEditing(_ editing: Bool, animated: Bool)
    
    
    open var showingDeleteConfirmation: Bool { get } // currently showing "Delete" button
    
    
    @available(iOS 9.0, *)
    open var focusStyle: UITableViewCell.FocusStyle
    
    
    // These methods can be used by subclasses to animate additional changes to the cell when the cell is changing state
    // Note that when the cell is swiped, the cell will be transitioned into the UITableViewCellStateShowingDeleteConfirmationMask state,
    // but the UITableViewCellStateShowingEditControlMask will not be set.
    @available(iOS 3.0, *)
    open func willTransition(to state: UITableViewCell.StateMask)
    
    @available(iOS 3.0, *)
    open func didTransition(to state: UITableViewCell.StateMask)
    
    
    /* Override this method to receive notifications that the cell's drag state has changed.
     * Call super if you want to apply the default appearance.
     */
    @available(iOS 11.0, *)
    open func dragStateDidChange(_ dragState: UITableViewCell.DragState)
    
    
    /* Controls whether the cell in the table view allows user interaction once it is part of a drag (UITableViewCellDragStateDragging).
     * Default is NO.
     */
    @available(iOS 11.0, *)
    open var userInteractionEnabledWhileDragging: Bool
}
